package C04;

public class Book {//书类
    //修饰符 数据类型 变量名;
    private String bookName;
    private String author;//作者
    private String publisher;//出版社名
    private double price;//价格

    //修饰符 返回值类型 方法名（形参列表）{}
    /**
     * 设置 书名
     * set方法 是有参数的公共方法 无返回值
     * @param booknameParam
     */
    public void setBookName(String booknameParam){
        System.out.println("数据传输进入:" + booknameParam);

        bookName = booknameParam;
    }
    /**
     * 获取书名
     * get 方法是没有参数的公共方法  有返回值
     * @return
     */
    public String getBookName(){
        return bookName;
    }

    public void setAuthor(String authorParam){

        author = authorParam;
    }

    public String getAuthor(){

        return author;
    }

    public void setPublisher(String publisherParam){

        publisher = publisherParam;
    }

    public String getPublisher(){

        return publisher;
    }


    public void setPrice(double priceParam){

        price = priceParam;

    }

    public double getPrice(){
        return price;
    }


    public String getBookInfo(){

        return "书名:" + bookName +"\n作者:" + author
                +"\n出版社名:" + publisher + "\n价格:" + price+ "$";
    }

}
